package com.norbitltd.guavaleaves.java.util;

import java.util.Date;
import java.util.TimeZone;

import com.google.common.base.Predicate;

public class TimeZonePredicates {

	public static Predicate<TimeZone> hasSameRules(final TimeZone timeZone) {
		return new Predicate<TimeZone>() {
			public boolean apply(TimeZone input) {
				return input.hasSameRules(timeZone);
			}
		};
	}

	public static Predicate<TimeZone> inDaylightTime(final Date date) {
		return new Predicate<TimeZone>() {
			public boolean apply(TimeZone input) {
				return input.inDaylightTime(date);
			}
		};
	}

	public static Predicate<TimeZone> observesDaylightTime() {
		return new Predicate<TimeZone>() {
			public boolean apply(TimeZone input) {
				return input.observesDaylightTime();
			}
		};
	}

	public static Predicate<TimeZone> useDaylightTime() {
		return new Predicate<TimeZone>() {
			public boolean apply(TimeZone input) {
				return input.useDaylightTime();
			}
		};
	}
}
